const ResponseError = require('../../../helper/ResponseError')

const tableName = 'wallet_address'

const find = async (knex, params, { accountId }) => {
  const findParams = params
  const result = await knex.service.find(tableName, findParams)
  return result
}

const get = async (knex, id, params, { accountId }) => {
  const getParams = params
  const record = await knex.service.get(tableName, id, getParams)
  return record
}

const create = async (knex, params, { accountId }) => {
  const createParams = params
  const record = await knex.service.create(tableName, createParams)
  return record
}

const update = async (knex, id, params, { accountId }) => {
  const updateParams = params
  const record = await knex.service.update(tableName, id, updateParams)
  return record
}

const remove = async (knex, id, accountId) => knex.service.remove(tableName, id)

module.exports = {
  find,
  get,
  create,
  update,
  remove,
}
